//这是一个用于包装其它组件的高阶组件，如果主观判断权限校验通过，那么return props.children就可以了

import useAuth  from "@/utile/useAuth"
import {Button} from "antd"
import {history} from "umi"
export default (props:any)=>{
    let [isLogin,setUserInfo] = useAuth({})
    let handleClick = ()=>{

    }
    if(JSON.stringify(isLogin)!=='{}'){
        return props.children
    }else{
        return (
            <div>
                <h1>请登录</h1>
                <Button type="primary" onClick={()=>{
                    history.push('login')
                }}>点击登录</Button>
            </div>
        )
    }
}

